package com.ruoyi.common.utils;

import com.ruoyi.common.utils.http.HttpUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ApiCallUtil {

    private static final Logger log = LoggerFactory.getLogger(ApiCallUtil.class);

    private static final String URL = "http://testapi.youzhi.net/api/yuwen/statTopman";

    private static final String SET_AUDIO_RECOM_URL = "http://testapi.youzhi.net/api/audio/setRecom";

    public static void statTopmain(long kkuid) {
        String param = String.format("kkuid=%s", kkuid);
        String rsp = HttpUtils.sendPost(URL, param);
        log.info("stat topman {}, rsp {}", kkuid, rsp);
    }

    public static void setAudioRecom(String id, int recom) {
        String param = String.format("articleId=%s&recom=%s", id, recom);
        String rsp = HttpUtils.sendGet(SET_AUDIO_RECOM_URL, param);
        log.info("set audio recom {} -> {}, rsp {}", id, recom, rsp);
    }
}
